package com.smitish.vueblog.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 *
 * </p>
 *
 * @author Smitish
 * @since 2020-11-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("m_blog")
public class Blog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 博客id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 作者id
     */
    private Long userId;

    /**
     * 博客标题
     */
    @NotBlank(message = "文章标题不能为空")
    private String title;

    /**
     * 博客摘要
     */
    @NotBlank(message = "文章摘要不能为空")
    private String description;

    /**
     * 博客内容
     */
    @NotBlank(message = "文章内容不能为空")
    private String content;

    /**
     * 博客创建时间
     */
    private LocalDateTime created;

    /**
     * 博客当前状态
     */
    private Integer status;

    /**
     * 博客头图
     */
    private String image;

    /**
     * 博客点赞数量
     */
    private Integer likes;

}
